import redis
import json
import time

if __name__ == '__main__':
    client = redis.Redis(host='127.0.0.1',port = 6379,db=2,password = 'xxxx')
    # a={"123":213,"qw":22}
    # da = json.dumps(a)
    # b={"122":214,"qwq":223}
    # db = json.dumps(b)
    # client.rpush("test","1")
    # client.rpush("test", "2")
    # data=json.loads(client.get("test"))
    # print(data)
    # print(type(data))
    # print(da)
    # print(db)
    # print(client["123"])
    client.rpush("test","1")
    # a=client.lrange("test",0,0)
    # print(a)
    # client.rpop("test")
    # a=client.lrange("test", 0, 0)
    # print(len(a))






    #
    # client.expire("alien",3000)  #设置生存周期为30秒
    # client.get("123")
